Team%#%28922% % Changkun%Ou,%Mu%Huang,%Mengxin%Shi%%%% %%%%%%%%%%Page%1%of%35%
For office use only
T1
________________
T2
________________
T3
________________
T4
________________
Team Control Number
28922
Problem Chosen
A
For office use only
________________
________________
________________
________________
2014 Mathematical Contest in Modeling (MCM) Summary Sheet
Summary
Our target is to analyze the driving principle Keep-Right-Except-To-Pass in two
aspects: one is the effects of traffic flow; the other is traffic security. As a result, we
formulate two methods to analyze a traffic process, which include four models and six
input data and output two indexes. Based on that, the results of analyzing the traffic
rules from three aspects are given to the driving rules and a suggestion to improve the
road driving rules is proposed. We also talk about some future expectations.
Six Parameters and Two Indexes
We analyse six parameters concerned with present traffic flow, which in-
clude the length of this road section researched, the probability that various vehi-
cles simultaneously appear in the road section, the speed limit section, the to-
tal time of the research process, the frequency that vehicles reach the road sec-
tion and the friction coefficient of the road. We designed two indexes to ana-
lyse this driving rules, which are traffic flow index and the number of vehicles hav-
ing potential safety hazard.
Two Methods and a Process
In order to analyze the two indexes output in a traffic process, we formulate two
technology roads containing the theory analysis and simulation program:
1. Under the condition that six input data are ensured, to acquire the theory value
of traffic flow by complex calculation based on the reasonable model hypothe-
sis.
2. In order to verify the veracity of the theory result, we use simulation program
to simulate 1000 traffic process in every special situation. After analyzing out-
put traffic flow index in 2000 experiments, we find that the theory results cor-
respond to the results of experiments. Not only are the theory results verified
right, but also the validity of the experiment method is ensured. Meanwhile, the
Team%#%28922% % Changkun%Ou,%Mu%Huang,%Mengxin%Shi%%%% %%%%%%%%%%Page%2%of%35%
experiments count the number of vehicles having potential safety hazard in a
simulation process, which provide reliable data to analyze the road security
with different input data.
Four Models and Three Questions
In order to assist these two methods that include the theory analysis and simulation
program, we formulate four models in total, which contain theory calculation, lane-
changing model, overtaking model and security analysis.
1. Theory calculation deduce a core index, that is, the function relation between
the theory value of traffic flow and six input data.
2. With the purpose of achieving simulation program method, we design the lane-
changing model and overtaking model. We analyze and discuss the process of
achieving Changing Method and overtaking Method packed by the Car Class
in the simulation process in detail.
3. But the security analyze model is designed to obtain the number of vehicles
with potential safety hazard in each simulation. Also, we talk about the detailed
operation that how such a model is successfully applied to program simulation.
First of all, we analyze the question that both traffic flow and security are low when
traffic rule Keep-Right-Except-To-Pass is applied to a heavy traffic road. Then, we an-
alyze the reason why the traffic rule Keep-Right-Except-To-Pass can't be applied to
those countries where it is required to drive on the left by simply exchanging left and
right. Eventually, we conclude that if we rule out certain inevitable factors, we can ac-
quire high traffic flow and few vehicles with potential safety hazard when the traffic
rule Keep-Right-Except-To-Pass is applied to an intelligent control system.
One Suggestions and Some Prospects
On the basis of three questions above, we analyze and put forward a suggestion to
improve the traffic rule Keep-Right-Except-To-Pass according to two indexes including
the velocity gradient and vehicle type. Ultimately, we also roughly discussed some pro-
spects of control system about using of unmanned technology in the future.
Team%#%28922% % Changkun%Ou,%Mu%Huang,%Mengxin%Shi%%%% %%%%%%%%%%Page%3%of%35%
A Study in Keep-Right-Except-To-Pass Rule
Abstract:% %
The purpose of this paper is to analyze the road traffic flow and security problem
under the driving rule Keep-Right-Except-To-Pass by formulating math model. More-
over, based on reasonable hypothesis, we use simulation data to represent the character
of act rules after considering the advantages and disadvantages. Finally, we set forth
and analyze different rule choice.
At the beginning, we analyze the road with many vehicles and road with few vehi-
cles respectively. Taking six indexes into account which includes the length of this
road section researched, the probability that various vehicles appear in the road section,
the speed limit section, the total time of the research process, the frequency that vehicles
reach the road section and the friction coefficient of the road, we deduce a theory index
that can measure the traffic flow performance. Meanwhile, we use simulation program
to simulate 1000 traffic process in every special situation. After analyzing output traffic
flow index in 2000 experiments, we find that the theory results correspond to the results
of experiments. It is also concluded that this traffic rule may lead to low traffic flow
and low security in the heavy traffic road, for which we set forth a suggestion to im-
prove according to the velocity gratitude and vehicle type.
Then, after analyzing the present research situation at home and abroad, we con-
tinue to use the data acquired by the math model combined with program simulation
and we conclude that the traffic rule Keep-Right-Except-To-Pass can't be applied to
those countries where it is required to drive on the left by simply exchanging left and
right. Furthermore, the traffic flow of countries where it is required to drive on the left
is bigger than that of countries where it is required to drive on the right, but the number
of vehicles with potential safety hazard of the former is larger.
Finally, combined with former models, we discuss that if we rule out certain inev-
itable factors, we can acquire high traffic flow and few vehicles with potential safety
hazard when the traffic rule Keep-Right-Except-To-Pass is applied to an intelligent con-
trol system. In addition, we broadly talk about the future exception about applying the
unmanned control system in the future.
Keywords: Mean Traffic Flow, Lane changing model, Overtaking model Safety anal-
ysis, The Monte Carlo method
Team%#%28922% % Changkun%Ou,%Mu%Huang,%Mengxin%Shi%%%% %%%%%%%%%%Page%4%of%35%
Contents
A Study in Keep-Right-Except-To-Pass Rule%..................................................................................%3%
I. Introduction%...........................................................................................................................%5%
1.1 The Couse%...................................................................................................................%5%
1.2 Issues Raised%..............................................................................................................%5%
II. Preparation%...........................................................................................................................%5%
2.1 Common Sense%...........................................................................................................%5%
2.2 Global Assumption%.....................................................................................................%6%
2.3 Symbol and Parameters%..............................................................................................%6%
III. Models%..............................................................................................................................%13%
3.1 Framework Design%...................................................................................................%13%
3.2 Lane-changing Model%...............................................................................................%18%
3.3 Overtaking Model%.....................................................................................................%19%
3.4 Security Analysis%......................................................................................................%21%
IV. Solutions%...........................................................................................................................%21%
4.1 Keep-Right-Except-To-Pass Performance Analysis%.................................................%21%
4.2 Keep-Left-Except-To-Pass Contrastive Analysis%.....................................................%26%
4.3 Intelligent Control%....................................................................................................%27%
4.4 Conclusion%................................................................................................................%28%
V. F ut u r e Wo r k %.......................................................................................................................%29%
5.1 Strengths%...................................................................................................................%29%
5.2 Disadvantages%...........................................................................................................%29%
5.3 Trends and Perspectives%...........................................................................................%30%
VI. References%........................................................................................................................%30%
VII. Appendix%.........................................................................................................................%31%
7.1 Code Kernel%..............................................................................................................%31%
7.2 Data%..........................................................................................................................%34%
%
Team%#%28922% % Changkun%Ou,%Mu%Huang,%Mengxin%Shi%%%% %%%%%%%%%%Page%5%of%35%
I. Introduction
1.1 The Couse
Artificial intelligence has become one of the greatest advances of the 21st century.
It can make the conventional traffic model safer, more efficient and energy save if we
design an intelligent-control system and make up some perfect road transport rules.
There is no doubt that this system will be a main stream in the future. In the system, the
vehicle can use its own control system to realize the unmanned or assistant-drive and
the traffic facilities can monitor and adjust the massage of the road condition by the
intelligent monitor system.
The traffic rules formulated by different coutries in the world are di-
verse. In many countries such as the U.S.A., China and so on, it is required that vehi-
clees run on the right and overtake the other from left, while the rules in some coun-
tries like are opposite.
Thus, developing a relatively perfect traffic rules are not only the first step in intel-
ligent control systems and even unmanned technology, but also the most important step.
A good set of criterion consider safe driving the first meaning and maximize the traffic
flow.
%
1.2 Issues Raised!
This paper aims through theoretical analysis and simulation programming compar-
ative analysis of two approaches in order to address the following issues:
l When analyzing fewer vehicles and more sections, consider the speed, security,
and other factors on the highway, and establish a mathematical model which is able
to measure traffic performance, to evaluate whether this rule could increase the
traffic flow by "Keeping-Right-Except-To-Pass"; if not , then modify the rules.
l Investigate whether the solution of the first problem can be applied directly on the
countries where cars keep to the left by simply changing the direction.
l Analyze that under the control of the intelligent system, how the traffic flow will
be affected in the solution of the first problem.
II. Preparation
2.1 Common Sense
In most countries where the vehicles run on the right, the highway is usually the
two-way four-lane road and a one-way two-lane road, that is, a super-lane carriageway.
Team%#%28922% % Changkun%Ou,%Mu%Huang,%Mengxin%Shi%%%% %%%%%%%%%%Page%6%of%35%
The leftmost lane is super, the middle lane is a way, and emergency lane at the far right
is an emergency use. According to the traffic rules, vehicles will be traveling in the
driveway, and long-term occupation of ultra-driveway is not permitted. Therefore, un-
der normal circumstances, overtaking the other car is from the left surpass lane.
%
Figure%2.1.1%Highway%Traffic%Rules%
2.2 Global Assumption
l Without considering the occurred accident is because of its own breakdown.
l Without considering the occurred accident is because of human’s wrong judgment
which was influenced by the weather condition.
l Without considering too big or small vehicles whose speed are beyond the limited%
range.
l Without considering the driver malicious behavior.
l Without considering the freeway road‘s individual characteristics impact on traf-
fic safety.
l Without considering the drivers who are nervous, stunned, or just surrender%
2.3 Symbol and Parameters
2.3.1 Symbol
Symbol
Explain
t
Observation period
[
)
0, t
time value
( )
Nt
In time interval
[
)
0, t
, the number of vehicles which entered lane
Team%#%28922% % Changkun%Ou,%Mu%Huang,%Mengxin%Shi%%%% %%%%%%%%%%Page%7%of%35%
Q
Road flow
v
Mean Velocity Interval
( )
i
t
The total time that vehicle
i
spent in running in the road whose
length is
L
T
,
( )
( )
i
Et
The average time by all vehicles spent on through the road
L
Lane length
( )
12
,
n
Ptt
The probability of
n
vehicles to arrive in the time interval
[
)
12
,tt
Traffic Flow Density
d
h
Space Headway
Time Headway
,1,2,,6
i
Ci=
Veh ic le m ode ls
,1,2,,6
i
C
Li=
Veh ic le m ode l
i
( )
,1,2,,6
i
PC i=
The probability that vehicle model
i
in the road
( )
i
v
An instantaneous speed of vehicle model
i
safe
s
The range of safety Vehicle distance
( )
light
V
Under the Light traffic, the speed limit range
( )
heavy
V
Under the Heavy traffic, the speed limit range
s
Safety distance between adjacent vehicles
µ
The friction coefficient of the vehicle and the road surface
( )
EQ
The average vehicle flow
%
2.3.2 Traffic Flow Parameters
The document [1] has expounded and defined a series of judging the element pa-
rameter of the traffic flow, and discussed the road character of the highway and its
abi-lity to pass the road in details. We will use some main parameters as the judg-
ment of the road traffic ability in this modeling.
Then, we begin to state its basic meaning.
Team%#%28922% % Changkun%Ou,%Mu%Huang,%Mengxin%Shi%%%% %%%%%%%%%%Page%8%of%35%
%
1. Flow
Flow
Q
points that, in a given time unit, the total number of vehicles through a
site, a section or a lane is named flow or traffic volume
( )
Nt
Q
t
=
%%%%%%%%%%%%%%%%%%%%%%%%%% (2.3.1)
2. Mean Velocity Interval
Velocity interval, which is called the driving speed, is what the traffic miles div-ide the
time needed to travel through the section (including the parking time).
Vel o c i ty i n t erv al i s a co mp o sit e in dic ato r, u sed to e v a lu ate t h e u n o bstr u c t ed d egr ee o f a
road, and estimate the situation of traffic delays. When we studying traffic capacity, mean ve-
locity interval is used as the speed standard. Mean Velo cit y Interval is the ratio be-
tween the journey of this road section and the average time
T
spent by all vehicles:
( )
( )
1
i
i
LL
v
T
t
Nt
==
(2.3.2)
Among it, the vehicle
i
had spent
( )
i
t
in the road section whose length is
L
.
3. Mean Traffic Flow Density
Vehicle flow density refers to number of a certain instantaneous vehicle a lane or
a direction in the length of the road. It reflects the proximity between traffic stream
vehicle degree, Sometimes it also can be represented by the total length of all vehicles
on the known road and the road length ratio. Lane space percentage show that:
( )
Nt
K
L
=
%
In the simulation experiments,
expectation is referred to as the average den-
sity.
%
Team%#%28922% % Changkun%Ou,%Mu%Huang,%Mengxin%Shi%%%% %%%%%%%%%%Page%9%of%35%
4. Space Headway
Space headway
d
h
is in a motorcade traveling in the same direction, the two ad-
jacent vehicles head space distance or interval.
5. Time Headway
Time headway
is referring to use the time to express Space headway
d
h
, also
called Time headway.
We can easily reach the conclusion that the relation of Time Headway, Space Head-
way and the velocity is:
( )
3.6
i
dt
v
hh=
%
2.3.3 Traffic flow Characteristics
We study the properties of traffic flow for a road whose length is
L
. It mainly
includes three aspects: The process of vehicles entering the road; Running process of
the vehicle on the road; the process that vehicle pass this road.
In 3.1.2, we will write code to input data on the basis of Traffic flow characteristics.
1. Input Process
Use
( )
Nt
to Show the number of vehicle road into the time interval
[
)
0, t
, and
let
( )
12
,
n
Ptt
represent the probability of
n
vehicles to arrive in the time interval
[
)
12
,tt
.
%
A. Light traffic
Under the light traffic, also the small vehicle flow density, and there is almost no
outside interference factors, so we make objective assumptions on the vehicle that ap-
peared in the road:
(1) In the number of non-overlapping time intervals vehicles entering the road sec-
tions are independent of each other,
Team%# %28922% % Changkun%Ou,%Mu%Huang,%Mengxin%Shi%%%% %%%%%%%%%%Page%10%of%35%
(2) For sufficiently small time
tΔ
the probability about a vehicle run and must
run in lane carriageway is irrelevant for
t
in the time interval
[
)
12
,tt
that is
( ) ( )
1
,Ptt t t o t
λ
+Δ = Δ + Δ
Among it, for
( )
otΔ
, When
0tΔ→
,
( )
otΔ
is A higher order infinitesimal about
tΔ
,
λ
is the number of vehicles entered into the road in a unit of time.
(3) For sufficiently small time
tΔ
the probability about one or two more vehi-
cles into the lane section is too small to be Neglected in the time interval
[
)
12
,tt
that is
( ) ( )
2
,
n
n
Ptt t o t
=
+Δ = Δ
According to the above three hypotheses, we are not difficult to obtain
( )
( )
0, , 1, 2,
!
n
t
n
t
Pt en
n
λ
λ
==
It shows that under the light traffic, the Input process obeys the Poisson distribu-
tion in the fixed section. Among it,
λ
as the average arrival rate parameters.
%
B. Heavy Traffic
Under the heavy traffic, the traffic is crowded, free driving the opportunity not to
be many. Then vehicles that entered the road are independently of each other, it can be
regarded as a independent repeated trials in essence. At this time, there is
( )
0, 1 , 1, 2,
nkn
n
k
tt
Pt n
n
kk
λλ
⎛⎞
⎛⎞
==
⎜⎟
⎜⎟
⎝⎠
⎝⎠
%
In other words, under the heavy traffic, the Input process obeys the binomial dis-
tribution in the fixed section. Among it,
λ
as the average arrival rate parameters.
C. Vehicle models
During input process, We enumerate six kinds of vehicle models as input
[9]
as
shown in Table 2.3.1, as a matter of convenience, we labeled different models as
,1,2,,6
i
Ci=
in turn. Of which the total car lengths are respectively labeled
,1,2,,6
i
C
Li=
, its appearance probability is denoted by
( )
,1,2,,6
i
PC i=
.
Team%# %28922% % Changkun%Ou,%Mu%Huang,%Mengxin%Shi%%%% %%%%%%%%%%Page%11%of%35%
Table 2.3.1 Outline dimensions of vehicle models
Project
Vehicle models
Outline dimensions(m)
Total length
Total width
The total height
Mini car
1
C
3.50
1.60
1.80
Car
2
C
4.80
1.80
2.00
Light car
3
C
7.00
2.10
2.60
Mid-size car
4
C
9.00
2.50
3.20
Large bus
5
C
12.00
2.50
3.20
Large truck
6
C
10.00
2.50
4.00
%
2. Running Process
A. Moving Status
In the process of driving in road whose length is
L
, we assume that the driver in
the driving only three kinds of demand: change, overtaking, maintain.
(1) In the traffic lane, the driver does not exist overtaking behavior, at this time
to drive the vehicle speed are the stable value, If traffic is relatively poor, have more
chance to free exercise, we consider the lane changing model in 3.2.
(2) But when traffic flow is crowding, and chances for free driving is less, we
pretend that drivers will neither overtake nor change lanes, just keeping lanes.
(3) When drivers produce the overtaking demand, we consider the overtaking
model in 3.3.
B. Speed Limited
The velocity limit during the process of driving can be classified into two cases.
Under the light traffic, we set the speed limit range is
( )
light
V
, or
( ) ( )
min max
,
light light
vv
⎡⎤
⎣⎦
. And
under the heavy traffic, we set the speed limit range is
( )
heavy
V
, or
( ) ( )
min max
,
heavy heavy
vv
⎡⎤
⎣⎦
. To
ensure that the result is true and reliable, we can suppose the velocity is
( ) ( ) ( )
,,
min max
,
i light heavy light heavy
vV V
⎡⎤
⎣⎦
and the section satisfy "
2
σ
", that is:
( ) ( ) ( )
( )
( ) ( )
( )
,, ,,
min max max min
11
~,
24
i light heavy light heavy light heavy light heavy
vNV V V V
⎛⎞
++
⎜⎟
⎝⎠
Team%# %28922% % Changkun%Ou,%M u%Huang,%Mengxin%Shi%%%% %%%%%%%%%%Page%12%of%35%
C. Safety distance
The Safety distance between adjacent vehicles depends on both the drivers' reac-
tion time and the cars' braking performance.Breaking mainly depends on the fric-
tional force between the tire and the ground the size of the friction depends on the co-
efficient of friction. Pretending that the coefficient of friction is
µ
, the friction dis-
tance is:
( )
( )
2
2
i
brake
v
s
g
µ
=
The coefficient of friction is related to many factors. The general value is 0.8 or so,
failing under 0.2 when raining, and even less when driving on the snow and ice road.
The reaction time of ordinary people is up to 0.2 seconds. when considering the
cars’ response time, we pretend that it takes 0.2 to 2 seconds to finish the total action .So
the safety distance between adjacent vehicles
s
is
( )
( )
( )
( )
( )
( )
22
0.2 , 2
22
ii
ii
safe
vv
ss v v
gg
µµ
⎡⎤
⎢⎥
= + +
⎢⎥
⎢⎥
⎣⎦
It may be that the safety distance meet "
3
σ
rule" in this interval, so the safety
distance between adjacent vehicles satisfies the relationship:
( )
( )
( )
( )
2
11
~ 1.1 ,
2 30
i
i
i
v
v
sN v
g
µ
⎛⎞
⎜⎟
+
⎜⎟
⎜⎟
⎝⎠
Safety space headway satisfies the relationship:
( )
( )
( )
( )
2
11
~ 1.1 ,
230
i
i
i
i
dC
v
v
hL N v
g
µ
⎛⎞
⎜⎟
+
⎜⎟
⎜⎟
⎝⎠
Safety time headway satisfies the relationship:
( )
( )
( )
( )
( )
2
11
~1.1,
3.6 2 30
i
i
ii
i
tC
v
vv
hL N v
g
µ
⎛⎞
⎜⎟
+
⎜⎟
⎜⎟
⎝⎠
Calculate part of the vehicle braking distance , as shown in Table 2.3.2, we can see
that, The braking distance is generally controlled at 30~150 on the highway.
%
%
%
%
%
Team%# %28922% % Changkun%Ou,%M u%Huang,%Mengxin%Shi%%%% %%%%%%%%%%Page%13%of%35%
Table 2.3.2 Part of the vehicle braking distance
Speed(km/h)
60
70
80
90
100
Braking distance(m)
34.4
43.5
53.7
64.9
77.0
Speed(km/h)
120
150
180
200
250
Braking distance(m)
104.2
152.4
209.4
252.4
377.0
%
3. Output Process
l Safety index: We utilize the relation between the rate of accident and the traffic
flow as the index of security assessment.
l Traffic flow index: the traffic flow is defined in the Formula 2.3.1. In some special
road sections, we only use this index to measure the traffic flow performance. Gen-
erally, we use the expectation of traffic flow
( )
EQ
as an index to measure the a
road section.
III. Models
3.1 Framework Design
A good packaging design can help us comprehend the function of the program
quickly and directly, and we expect the design have the black box which has the features
shown in Paint 3.1.1. We just need to input the specific parameters, and we will get the
output we need:
( )
( )
( )
( )
( )
,
,_ ,, ,,,
light heavy
i
E Q Safety Index TrafficProcess L P C V t
λµ
=
%
%
%
Figure 3.1.1 framework map of test the black box
%
We can feel in the above design,
( )
EQ
is
( )
( )
,
,, ,,,
light heavy
i
LPC V t
λµ
s function.
Theoretically speaking, it is impossible to cause accident under the situation that
the driver absolutely obeys the traffic rules. Consequently, the security index has to be
acquired via the simulation program.
Team%# %28922% % Changkun%Ou,%M u%Huang,%Mengxin%Shi%%%% %%%%%%%%%%Page%14%of%35%
3.1.1 Theoretical Analysis
The following derivation is about
( )
EQ
.
First of all, it’s easy to calculate the average length is
( ) ( )
6
1
i
CiC
i
EL PC L
=
=
We can know by the Formula 2.3.2,
( )
( )
( )
( )
( )
( )
( )
( )
( )
( )
( )
( ) ( )
22
66
11
,,
min max
1.1 1.1
11
22
11 2
66
ii
ii
ii
ii
light heavy light heavy
ii
vv
LvLv
Ls
gg
Ev
L
tt
Nt Nt
VV
µµ
==
++ ++
+
== =
+
∑∑
∑∑
So, the number of vehicles about the average time that all vehicles passing through the
road is
( )
( )
( )
( )
( )
( )
( )
( )
( )
( )
( )
( )
( ) ( )
66
11
22
66
11
,,
min max
66
1.1 1.1
22
12
ii
iC iC
C
ii
out
ii
ii
i
ii
light heavy light heavy
i
PC L PC L
EL
N
Ev
vv
LvLv
gg
L
t
Nt
VV
µµ
==
==
== =
++ ++
+
∑∑
∑∑
Obviously, according to the hypothesis of the input process above, when driv-
ing out, for a time
tΔ
that is short enough, in the time range
[
)
,tt t+Δ
, the probabil-
ity that a vehicle leaves the road section does not relate to the
t
and is propor-
tional to the length of the range
tΔ
, that is:
( ) ( )
out
Ptime t N t o t≤Δ = Δ + Δ
We realize that at the moment
tt+Δ
, the condition that there are
n
vehicles in the
road section is converted from the condition below
(1) There are
n
vehicles at the moment
t
and no vehicles enter or leave, whose
proportion is
( )
1
out
tN to t
λ
−Δ Δ+ Δ
(2) There are
1n +
vehicles at the moment
t
and no vehicles enter but a vehicle
leave, whose proportion is
( )
out
NtotΔ+ Δ
(3) There are
1n
vehicles at the moment
t
and no vehicles leave but a vehicle
Team%# %28922% % Changkun%Ou,%M u%Huang,%Mengxin%Shi%%%% %%%%%%%%%%Page%15%of%35%
enter, whose proportion is
( )
to t
λ
Δ+ Δ
According to the hypothesis, there are only three conditions above, and the propor-
tion of other condition is too small to be considered. At the moment
tt+Δ
, the pro-
portion that there are n vehicles in the road section is
( ) ( )( ) ( ) ( ) ( )
11
0, 0, 1 0, 0,
nn outnoutn
PttPt tNtP tNtP t tot
λλ
+
+Δ = Δ Δ + Δ + Δ + Δ
When
0n =
, otherwise
( ) ( )( ) ( )( ) ( )
1
0, 0, 1 0, 1
nn out
PttPt tPt tNtot
λλ
+Δ = Δ + Δ Δ + Δ
Make
0tΔ→
, and we will notice that
( )
0,
0
n
dP t
dt
=
( Because the probability is not
connected with time), there are the following equations
( ) ( ) ( ) ( )
( ) ( )
11
01
0, 0, 0, 0
0, 0, 0
n out n out n
out
PtNPt NPt
PtNPt
λλ
λ
+
++=
+ =
We get
( ) ( )
0
0, 0,
n
n
out
Pt Pt
N
λ
⎛⎞
=
⎜⎟
⎝⎠
Notice
( )
0
0, 1
n
n
Pt
=
=
If
1
out
N
λ
<
, there are
( ) ( )
0
0, 1 , 0, 1
n
n
out out out
Pt Pt
NNN
λλλ
⎛⎞
= =
⎜⎟
⎝⎠
If
1
out
N
λ
, the traffic jam will happen, leave out.
So far, we can easily obtain the number (
( )
Nt
) of the vehicles that enter the road sec-
tion during the time section
[
)
0, t
, which is
Team%# %28922% % Changkun%Ou,%M u%Huang,%Mengxin%Shi%%%% %%%%%%%%%%Page%16%of%35%
( ) ( )
0
0
0,
n
out
Nt nP t
N
λ
λ
=
==
(3.1.1)
Bring
out
N
into
the Formula 3.1.1, we can get the equation
( )
( )
( )
( )
( ) ( )
( )
6
1
2
6
1
,,
min max
6
1.1
2
2
i
iC
i
i
i
i
light heavy light heavy
Nt
PC L
v
Lv
g
L
VV
λ
λ
µ
=
=
=
++
+
Get:
( )
( )
( )
( )
( )
( ) ( )
( )
( )
( )
( ) ( )
( )
6
1
2
,,
min max
6
1
,,
min max
6
2
11
1.1
2
2
i
iC
C
i
light heavy light heavy
i
i
i
light heavy light heavy
PC L
LE L
Nt
LEs V V
v
Lv
g
L
VV
λ
µ
λ
=
=
==
++
++
+
Finally, according to the Formula 2.3.1, we get:
( )
( )
( )
( )
( )
( )
( ) ( )
( )
( )
( )
( )
( ) ( )
( )
,,
min max
,,
min max
2
1
2
C
light heavy light heavy
C
light heavy light heavy
ENt
LE L
EQ
tt
tL Es V V
LE L
tL Es V V
λ
λ
==
++
++
%
3.1.2 Monte Carlo Method
In 2.3.3, we have already roughly introduced the driving behavior on the road. In
order to insure the reliability of theoretical result, we try using the Monte Carlo
method to have an auxiliary contrast for the theoretical result, to make the result more
reliable. Meanwhile, we count the security index from the experiment.
We set fixed parameters for an experiment:
test time
t
, road length
L
, car types
i
, numbers of occurrences
( )
i
PC
,
the speed limit range
( )
,light heav y
V
, arrival rate , coefficient of friction
µ
λ
Team%# %28922% % Changkun%Ou,%M u%Huang,%Mengxin%Shi%%%% %%%%%%%%%%Page%17%of%35%
We set fixed parameters for an experiment: test time
t
, road length
L
.
Using the object-oriented design method, we abstract the elements and the pro-
cess in the total experiment to two objects: cars and roads.
In terms of cars, we use the unified modeling language (UML) to express it. As
shown in Figure 3.1.2. (As Figure 3.1.2 shows)
Figure 3.1.2 the Class Diagram of Car Class and Class Diagram of Lane Class
%
In the process of the simulation, just need to invoke the overtaking method so as
to overtake. The realization of this method is shown as 3.3. If overtaking fails, send a
message to the road object, letting the object decide whether the experiment will con-
tinue or not.
To roads, when analyzing problems, we have pointed out the design features of
the highway in most countries people drive on the right, that in essence, there are only
two lanes under the condition that we don't consider the emergency lane. In the same
way, we use UML to describe the road object as Figure 3.1.2 shows.
The road object contains a status attribute, also called road safety attribute. In the
process of the experiment, check the status in time. If the road status reveals that an
accident happens in an experiment, we identify that the experiment fail, and have an-
other one experiment.
Above all, we obtain the design of the whole simulation progress, shown in the
Figure 3.1.3.
When the road condition is updated, so are the road situation (if the road situation
is good), the number of vehicles in the road (the total number of the vehicles at present),
the Time Headway and Space Headway of every vehicle (the journey at this time is the
journey after changing the direction, which correspond to the probability distribution
described in 3.3.2), etc.
Ultimately two values are output: one is the mean discharge and the other is the
existence of security problems of vehicle.
%
Team%# %28922% % Changkun%Ou,%M u%Huang,%Mengxin%Shi%%%% %%%%%%%%%%Page%18%of%35%
%
Figure 3.1.3 the Process of main()’s Method Design
%
3.2 Lane-changing Model
The lane changing module is designed to help the result of simulation program be
more true and reliable. In the lane changing module, only the lane changing in carriage-
way is considered. You can refer to the surpassing module in 3.3 to realize the lane
changing between overtaking lane and carriageway.
To ensure the security, we always consider the situation that vehicle move to the
carriageway where the Time Headway is bigger. Due to that, the flow diagram design
is shown by the Figure 3.2.1.
Team%# %28922% % Changkun%Ou,%M u%Huang,%Mengxin%Shi%%%% %%%%%%%%%%Page%19%of%35%
%
Figure 3.2.1 the Process of Lane Changing Method Design
3.3 Overtaking Model
3.3.1 Overtaking Demand and Overtaking Capability
Drivers want to keep the speed we wants when driving on the road, but the com-
plexity of the traffic composition, the difference among vehicle types and drivers' per-
sonalities, result in the big difference in desired speed between the drivers and the
cars
[2-4]
, in which some cars are faster and other drives more slowly. When the faster
car runs behind the slower car, the fast hopes to keep its own expected speed, so over-
taking is in demand. When finding that there is a certain amount of clearance between
traffic flow in the overtaking lane and cars in the traffic lane, the vehicle which
wishes to overtake starts to run into the overtaking lane to overtake; when the overtak-
ing behavior is finished, the car returns to the driving lane.
As we can see, taking an overtaking behavior on a two-lane highway mainly
have two reasons: One is that there is a speed difference between cars, and the over-
taking in demand; the other is that traffic flow in the overtaking lane and the place be-
tween cars in the traffic lane could offer the capacity needed to overtake and return.
3.3.2 Overtaking Process
The process of overtaking is shown in 3.3.1, Car
1n +
and Car
2n +
respec-
tively represent the car ahead and the first car. Car
n
will have an overtaking behavior;
car
is running in the overtaking lane.
Team%# %28922% % Changkun%Ou,%M u%Huang,%Mengxin%Shi%%%% %%%%%%%%%%Page%20%of%35%
We suppose the Time Headway between the front vehicle
1n +
and overtaking ve-
hicle
n
is
( )
,1tnn
h
+
; after returning the carriageway, the Time Headway between front ve-
hicle
n
and overtaking vehicle
1n +
is
( )
*
,1tnn
h
+
, which should be safe and satisfy the re-
lation:
( )
( )
( )
( )
( )
( )
2
*
,1
11
~1.1,
3.6 2 30
i
i
ii
i
C
tnn
v
vv
hLN v
g
µ
+
⎛⎞
⎜⎟
+
⎜⎟
⎜⎟
⎝⎠
Figure 3.3.1 the Overtaking Process
When Car
n
overtakes, based on in the overtaking lane Car
is overtak-
ing but not finished yet, and that the cars behind is likely to overtake, consider-
ing safety, Car
n
cannot stay on the overtaking lane for a long period of time,
and shall run into the place between Car
1n +
and Car
2n +
, That is offering enough
time headway.
To sum up, the design process of overtaking method as shown in Figure 3.3.2.
Figure 3.3.2 the Process of Overtaking Method Design
Team%# %28922% % Changkun%Ou,%M u%Huang,%Mengxin%Shi%%%% %%%%%%%%%%Page%21%of%35%
3.4 Security Analysis
Safety analysis is designed to help program to analogize outputting the quantity of
the potential safety hazard .Below we construct analysis method for the safety of vehi-
cle operation, analysis of vehicle distance control.
A vehicle is called hidden safety problems, if it meets the following conditions:
( )
( )
( )
( )
( )
( )
( )
( )
( )
( )
22
*
,1
11 11
0, 1.1 1.1 ,
3.6 2 10 2 30
i
ii
iii
ii
C
tnn
vv
vvv
hL v v
gg
µµ
+
⎛⎞
⎜⎟
−∈ + − ∪ + + +
⎜⎟
⎜⎟
⎝⎠
%
%
IV. Solutions
To composite the various module design in Part 3 Modules, we use C++ to program
an application. This application, which simulates a road section whose length is
L
,
output every character of traffic flow in a road section during a time cycle which is set
as
t
. The code is referred to the Appendix 7.1.
Next we will analyze those three questions in 1.2 in two ways: the theory result and
simulation result.
4.1 Keep-Right-Except-To-Pass Performance Analysis
4.1.1 in Light Traffic
1. Theoretical Results
We use the consequence of 3.1 to calculate the process below:
( )
( ) { }
( )
[ ]
0.15, 0.2,0.3, 0.2,0.1, 0.05
30 ,
,
90,120 / ,
240 min,
,
0.8
i
light
Lkm
PC
Vkmh
E Q TrafficProcess
t
k
λ
µ
=
⎛⎞
⎜⎟
=
⎜⎟
⎜⎟
=
⎜⎟
=
⎜⎟
=
⎜⎟
=
⎜⎟
⎜⎟
=
⎝⎠
Among it
1, 2, 10.kk
λ
==
In order to a straightforward, put the result of
( )
EQ
as Figure 4.1.1, accurate
Team%# %28922% % Changkun%Ou,%M u%Huang,%Mengxin%Shi%%%% %%%%%%%%%%Page%22%of%35%
data refer to Appendix 7.2. The changing situation we can see is:
%
%
Figure 4.1.1 the Changing Situation of
( )
EQ
Along with the Arrival Rate Changes
2. Simulation Results
Aiming at the inputting data, we simulate 1000 experiments in all. Taking
3k =
and
5k =
for example, put the results the program output as the Figure 4.1.2 and Fig-
ure 4.1.3.
%
Figure 4.1.2 the Simulation of Results Fluctuation when
3k =
%
%
0
0,002
0,004
0,006
0,008
0,01
0,012
0,014
0,016
0,018
0 2 4 6 8 10 12
0
0,001
0,002
0,003
0,004
0,005
0,006
0,007
0,008
0,009
1
39
77
115
153
191
229
267
305
343
381
419
457
495
533
571
609
647
685
723
761
799
837
875
913
951
989
Team%# %28922% % Changkun%Ou,%M u%Huang,%Mengxin%Shi%%%% %%%%%%%%%%Page%23%of%35%
%
Figure 4.1.3 the Simulation of Results Fluctuation when
5k =
It is clear that simulation results are stable over a range, so we believe that the
simulation results are coincide with the theoretical results.
The application also output the number of accidents in 1000 experiments. In order
to reflect the simulation results directly, a graph is used to show the relation between
the number of accidents and the vehicles passing the road section, as shown in the Fig-
ure 4.1.4.
%
%
Figure 4.1.4 Relationship between Vehicles existed Security Problems and Traffic
As we can see in Figure 4.1.4, the number of hidden safety problems of the vehicle
are maintained at below 10 and the fluctuation is stable, so the safety is all right under
the light traffic.
0
0,001
0,002
0,003
0,004
0,005
0,006
1
37
73
109
145
181
217
253
289
325
361
397
433
469
505
541
577
613
649
685
721
757
793
829
865
901
937
973
0
5
10
15
20
25
30
35
40
308
311
314
317
320
323
326
329
332
335
338
341
344
347
350
353
356
359
362
365
368
371
374
377
Team%# %28922% % Changkun%Ou,%M u%Huang,%Mengxin%Shi%%%% %%%%%%%%%%Page%24%of%35%
4.1.2 in Heavy Traffic
1. Theoretical Results
We use the consequence of 3.1 to calculate the process below:
( )
( ) { }
( )
[ ]
0.15, 0.2,0.3, 0.2,0.1, 0.05
30 ,
,
50,100 / ,
240 min,
,
0.8
i
heavy
Lkm
PC
Vkmh
E Q TrafficProcess
t
k
λ
µ
=
⎛⎞
⎜⎟
=
⎜⎟
⎜⎟
=
⎜⎟
=
⎜⎟
=
⎜⎟
=
⎜⎟
⎜⎟
=
⎝⎠
Among it
1, 2, 10.kk
λ
==
In order to a straightforward, put the result of
( )
EQ
as Paint 4.1.5, accurate data
refer to Appendix 7.2. The changing situation we can see is:
Figure 4.1.5 the Changing Situation of
( )
EQ
Along with the Arrival Rate Changes
This result is similar to the theory of the 4.1.1.
2. Simulation Results
Aiming at the inputting data, we simulate 1000 experiments in all. Taking
3k =
and
5k =
for example, put the results the program output as the Figure 4.1.6 and Fig-
ure 4.1.7.
0
0,005
0,01
0,015
0,02
0,025
0 2 4 6 8 10 12
Team%# %28922% % Changkun%Ou,%M u%Huang,%Mengxin%Shi%%%% %%%%%%%%%%Page%25%of%35%
Figure 4.1.6 the Simulation of Results Fluctuation when
3k =
Figure 4.1.7 the Simulation of Results Fluctuation when
5k =
It is clear that simulation results are stable over a range, so we believe that the
simulation results are coincide with the theoretical results.
The application also output the number of accidents in 1000 experiments. In order
to reflect the simulation results directly, a graph is used to show the relation between
the number of accidents and the vehicles passing the road section, as shown in the Fig-
ure 4.1.8.
Figure 4.1.8 Relationship between Vehicles existed Security Problems and Traffic
0
0,002
0,004
0,006
0,008
0,01
0,012
1
47
93
139
185
231
277
323
369
415
461
507
553
599
645
691
737
783
829
875
921
967
0
0,001
0,002
0,003
0,004
0,005
0,006
0,007
0,008
0,009
1
47
93
139
185
231
277
323
369
415
461
507
553
599
645
691
737
783
829
875
921
967
0
5
10
15
20
25
30
35
40
308
311
314
317
320
323
326
329
332
335
338
341
344
347
350
353
356
359
362
365
368
371
374
377
Team%# %28922% % Changkun%Ou,%M u%Huang,%Mengxin%Shi%%%% %%%%%%%%%%Page%26%of%35%
As we can see in Figure 4.1.8, the number of hidden safety problems of the vehi-
cle are rosing to about 20 and the fluctuation is not stable, so under the light traffic,
there is dangerous drive vehicle on the highway.
4.1.3%to%Discuss%the%Improvement%Method%about%Keep-Left-Except-To-Pass%
In order to improve traffic flow in the heavy traffic case, we need to put forward
the improvement method of "Keep-Right-Except-To-Pass", our improved method is
add the following rules in the "Keep-Right-Except-To-Pass" basis:
From left to right, setting carriageway in a certain speed gradient. At the same
time, redefining the concept of the overtaking lane according to vehicle models. For
example, large trucks can only use the right lane and only to overtake in the second
right lane. Then for large trucks, the lane is overtaking lane, the left lane is this type
of overtaking lane. The other case analogy.
Because this model is no longer applicable this set of traffic rules, we no longer
make detailed theoretical analysis due to limited space, here only discuss the feasibil-
ity of a solution.
After adding some rules, vehicles will get a better classification on the road, for
large trucks running slower, they are always in the right lane, there will not occur the
phenomenon that randomly occupied the carriageway and subsequent vehicles can't
overtake. In this case, not only to enhance the success rate of overtaking, but also
enhance the traffic flow, but also convenient traffic management.
4.2 Keep-Left-Except-To-Pass Contrastive Analysis
The situation may change in the countries where it is re-
quired to drive on the left. Although the difference between driv-
ing on the left and on the right is only mirror symmetry, driving on the left theory
should be identical to the right road. But from a series of researches in the litera-
tures [5-7] we can come to the conclusion
On the one hand, on the left side of the road, accident fatality rate can be reduced.
In case of emergency, most people will instinctively tilted to the left or turn a direction.
On the other hand, when the lane change, there is a high probability of the driver
which is moving to left lane rearview at left rear mirror and a high probability of the
driver which is moving to right lane rearview at right rear mirror. That show that the
driver mainly to obtain external information from the lane-changing, traffic information
from the lane-changing is much more important. In the entire decision-making and im-
plementation stage, the driver to obtain information more widely range and the driver's
visual scanning is more flexible when they move a lane to right. Therefore, on the left
side of the road, overtaking has better flexibility and security.
The causes above don't change the input data, but we can believe that the driver
can precisely control the distance between two vehicles. As a result, the updated infor-
mation of the road condition described in 3.1.2 should be adjusted subtly. We adjust the
Team%# %28922% % Changkun%Ou,%M u%Huang,%Mengxin%Shi%%%% %%%%%%%%%%Page%27%of%35%
program to simulate the method for generating random values, the results as shown in
Figure 4.2.1, details see Appendix 7.2.
%
Figure 4.2.1 theoretical
( )
EQ
about on the left side of road contrast with Simulation
According to the results of 2000 experiments composed by the theoretical results
and simulation results in 4.1, we believe that the theoretical results are reliable. Here
we derive the theoretical results (as shown in Figure 4.1.2, details see Appendix 7.2),
compared with the experimental results, it is not difficult to find:
The traffic flow under the condition of driving on the left is higher than that of
driving on the right. Nonetheless, the number of vehicles driving on the left which has
hidden danger is bigger.
4.3 Intelligent Control
In the intelligent control system, we can use the laser ranging system (LIDAR) to
detect the distance between cars, In front of the vehicle speed and the speed of vehicles
behind and a series of parameters, that is to do precise control when driving. Then,
effects of some random variable model (the speed of vehicle overtaking, after the com-
pletion of the overtaking vehicle speed and so on) translated into the constants which
is in the intelligent control.
At this moment, in our model,
( )
EQ
finally degenerate to the theoretical results.
And based on our global assumption, there is no car which has safety problems.
At present, intelligent control system can always find the best driving solu-
tion, hence
( )
EQ
is a function only concerned with the speed limit
( )
,light hea v y
V
sec-
0
0,002
0,004
0,006
0,008
0,01
0,012
0,014
0,016
0,018
1 2 3 4 5 6 7 8 9 10
Theoretical%Results Simulation%Results
Team%# %28922% % Changkun%Ou,%M u%Huang,%Mengxin%Shi%%%% %%%%%%%%%%Page%28%of%35%
tion. And the bigger
( ) ( )
,,
min max
light heav y light heavy
VV+
is, the bigger are the traffic flow and driv-
ing efficiency, that is:
( )
( )
( )
( )
,
,_
light heavy
E Q Safety Index TrafficProcess V→∞ =
4.4 Conclusion
4.4.1 Question One
( )
( )
( )
( )
( )
,
,_ ,, ,,,
light heavy
i
E Q Safety Index TrafficProcess L P C V t
λµ
=
(1) The calculation results of the theoretical models we built according to the driv-
ing rules "Keep-Right-Except-To-Pass" is matched with the results of the programming
simulation, so the model we built has certain reliability.
(2) In the cases of light traffic, the number of cars which have safety problems is
under ten, and the volatility of the cars is steady, so in the light-traffic cases, the safety
is well.
(3) In the cases of heavy traffic, the numbers of cars which have safety problems
increased to 20 or so. Compared to the light-traffic cases, the safety is failing, and is
not very stable, so in the heavy-traffic cases, driving on the highway has a certain risk.
(4) Compare the theoretical
( )
EQ
of the light traffic with the theoretical
( )
EQ
of the heavy traffic, although intuitively the number of the cars is quite large, the
Speed is limited because of the crowed traffic, and decrease the traffic flow.
(5) In order to increase the traffic flow in the heavy traffic, we come up with the
improved method of "Keep-Right-Except-To-Pass". Based on the "Keep-Right-Except-
To-Pass", increase the following rules: set the driveway according to a certain speed
limit gradient from the left to right, at the same time, divide the various overtaking lanes
according to the car types. For example, a large truck can only run on the rightist lane
and use the second rightist lane to overtake, and so on.
4.4.2 Question Two
(1) This "Keep-Right-Except-To-Pass" driving standards cannot be simply changed
to apply to those provisions driving on the left countries
(2) The traffic flow keeping to the left is higher than the traffic flow keeping to the
right, but the number of the cars which have hidden trouble is also higher than the
number of the cars keeping to the right.
Team%# %28922% % Changkun%Ou,%M u%Huang,%Mengxin%Shi%%%% %%%%%%%%%%Page%29%of%35%
4.4.3 Question Three
( )
( )
( )
( )
,
,_
light heavy
E Q Safety Index TrafficProcess V→∞ =
(1) In our model,
( )
EQ
finally degenerate to the theoretical results. At this mo-
ment, the intelligent control system can always find the best driving strategy, and thus
( )
EQ
is just the function of the speed limit range
( )
,light hea v y
V
. And the bigger
( ) ( )
,,
min max
light heav y light heavy
VV+
is, the bigger the traffic flow is, and the higher the driving effi-
ciency is.
(2) Based on our global assumption, in the intelligent control system, there is no
car which has hidden trouble.
V. Future Work
5.1 Strengths
l Simulation on the basis of theoretical analysis and programming point of view to
analyze and contrast the results, increased the reliability of data.
l We have taken many parameters react the condition of the real traffic into ac-
count: test time
t
, road length
L
, car types
i
, numbers of occurrences
( )
i
PC
,
the speed limit range
( )
,light heav y
V
, arrival rate
λ
, coefficient of friction
µ
.
l We almost ignored all potential safety hazard caused by human fac-
tor. It seems that it can't match the intelligent driving in the prob-
lem 3. But as a matter of fact, except the security hidden danger caused by hu-
man factor, the module shows that there are still vehicles with poten-
tial safety hazard. Consequently intelligent driving is much better than hu-
man driving.
5.2 Disadvantages
There are many control factors have joined the programming model, but the actual
situation is more complicated. About Traffic accidents and road traffic conditions, there
are many uncontrollable factors, such as the road condition, the driver malicious driving
etc. If we want to simulate more accurate actual effect, we need to add more control
variables which is not considered (such as the fuzzy factor that responses surface con-
ditioned.) to simulate.
Team%# %28922% % Changkun%Ou,%M u%Huang,%Mengxin%Shi%%%% %%%%%%%%%%Page%30%of%35%
5.3 Trends and Perspectives
It has been successfully used for the unmanned vehicle to technology companies
including Google as the representative, and the French company RobuRide, Holland
Company ParkShuttle etc. Widespread use of this technology can not only prevent traf-
fic accidents, and through the precise control of reducing carbon emissions from cars
use. The more important point, also it can give people more leisure time.
However, there are still many problems cannot be ignored, the most controversial
is the moral problem. In the present situation the development of science and technol-
ogy, unmanned technology is still not mature. Unmanned technology is always regard
the protection of personnel inside the vehicle and the vehicle as the first priority, but a
driver may be willing to sacrifice his own car to protect others. For example, if the
vehicle in front suddenly slip when you are driving, it's hard to stop. At this time, a big
truck is on the left, most drivers would choose crashed into the side of the road and not
mounted to the truck. But the unmanned technology will make what decision, we seem
to also can’t predict
[8]
.
Thus, the development of Unmanned Technology shoulders heavy responsibilities
and has a long way to go. Only the true Human Intelligence is given control system,
can it achieve the intelligent traffic system required safety, green, efficient requirements.
VI. References
%
[1] 谢军. 高速公路通行能力分析与服务质量评价研究[D]. Shaanxi: Chang'an
University, 2007.
[2] 刘江等. 驾驶员气质与行车速度关系的初步研究[J] 北京工业大学学报,
2006,32(1):27-32.
[3] 荣建等. 基于可变跟驰时间和随机因素的通行能力理论计算模型[J]. 中国公
路学报, 2001, 14(3):81-85.
[4] 魏朗等. 驾驶员道路安全感受模糊评判模型[J]. 交通运输工程学报, 2004,
4(1):102-105.
[5] Ke H. Study on driver's lane change behavior and law of eye movement in urban
environment[D]. Xi'an:Chang'an University, 2010.
[6] Wikipedia. Right and left hand traffic[EB/OL]. [2014-2-7].
http://en.wikipedia.org/wiki/Right-_and_left-hand_traffic.
[7] 百度百科. 道路通行方向[EB/OL]. [2014-2-7].
http://baike.baidu.com/link?url=kg7xjpS-
INfQO36YH99uY4D_vwUeSrlUgnVfTIChI6gKWOn7Us7ij4PAQ2k3MeyTp7q3pS2
XieWIKyLgOyvSOa.
[8] 王嘉伟等. 浅谈智能交通与无人驾驶技术的发展展望[J]. TECHNOLOGICAL
DEVELOPMENT OF ENTERPRISE, 2011, 30(14).
[9] law110.com. Design Code for Garage JGJ100-98[EB/OL]. [2014-2-7].
http://www.law110.com/lawserve/guihua/1800030.htm.
Team%# %28922% % Changkun%Ou,%M u%Huang,%Mengxin%Shi%%%% %%%%%%%%%%Page%31%of%35%
VII. Appendix
7.1 Code Kernel
//
// Car.h
// LaneSimulation
//
// Created by Team# 28922 on 14-2-8.
// Copyright (c) 2014 Team# 28922. All rights reserved.
//
#ifndef __LaneSimulation__Car__
#define __LaneSimulation__Car__
#include <iostream>
class Car
{
public:
Car();
~Car();
bool Overtaking();
bool Changing();
float length;
float velocity;
float first_headway;
float last_headway;
};
#endif /* defined(__LaneSimulation__Car__) */
//
// Lane.h
// LaneSimulation
//
// Created by Team# 28922 on 14-2-8.
// Copyright (c) 2014 Team# 28922. All rights reserved.
//
#ifndef __LaneSimulation__Lane__
Team%# %28922% % Changkun%Ou,%M u%Huang,%Mengxin%Shi%%%% %%%%%%%%%%Page%32%of%35%
#define __LaneSimulation__Lane__
#include "Car.h"
#include <iostream>
#include <vector>
class TrafficLane
{
public:
TrafficLane();
~TrafficLane();
public:
int getCarNum(){ return car_num; }
void updateCarNum(int car_num){ this->car_num = car_num; }
float getLaneUseRase(){ return lane_use_rase; }
void updateLaneUseRase(float lane_use_rase){ this->lane_use_rase = lane_use_rase; }
private:
int car_num;
float lane_use_rase;
};
class OverTakingLane
{
public:
OverTakingLane();
~OverTakingLane();
public:
int getCarNum(){ return car_num; }
void updateCarNum(int car_num){ this->car_num = car_num; }
float getLaneUseRase(){ return lane_use_rase; }
void updateLaneUseRase(float lane_use_rase){ this->lane_use_rase = lane_use_rase; }
private:
int car_num;
float lane_use_rase;
};
class Lane
{
public:
Lane();
Lane(float length, std::vector<float> propability, std::vector<float> speed_range,
float time, float arrive_rate, float miu);
~Lane();
public:
Team%# %28922% % Changkun%Ou,%M u%Huang,%Mengxin%Shi%%%% %%%%%%%%%%Page%33%of%35%
Car* cars;
bool isNewCar();
bool isSafe();
float getTrafficFlow();
bool updateRoad();
private:
float total_time;
float length;
bool statu;
float max_speed;
float min_speed;
float miu;
int nusafe_num;
float arrive_rate;
std::vector<float> car_propability;
TrafficLane *lane_traffic;
OverTakingLane *lane_pass;
};
#endif /* defined(__LaneSimulation__Lane__) */
//
// main.cpp
// LaneSimulation
//
// Created by Team# 28922 on 14-2-8.
// Copyright (c) 2014 Team# 28922. All rights reserved.
//
#include "Car.h"
#include "Lane.h"
#include <iostream>
int main(int argc, const char * argv[])
{
float lenth = 30;
std::vector<float> propability = {0.15, 0.2, 0.3, 0.2, 0.1, 0.05};
std::vector<float> speed_range = {90, 120};
float total_time = 4;
float arrive_rate = 1;
float miu = 0.8;
float t = 30;
Team%# %28922% % Changkun%Ou,%M u%Huang,%Mengxin%Shi%%%% %%%%%%%%%%Page%34%of%35%
Lane lane(lenth, propability, speed_range, total_time, arrive_rate, miu);
while (t+=0.01 != t) {
lane.isNewCar();
lane.cars->Changing();
lane.cars->Overtaking();
lane.updateRoad();
if (!lane.isSafe())
break;
}
return 0;
}
7.2 Data
Table 7.2.1
( )
EQ
theoretical value ("right rule" light traffic)
Arrival Rate
Mean Traffic Flow
1!
0.016667%
2!
0.008333%
3!
0.005556%
4!
0.004167%
5!
0.003333%
6!
0.002778%
7!
0.002381%
8!
0.002083%
9!
0.001852%
10!
0.001667%
%
Table 7.2.2
( )
EQ
theoretical value ("left rule" heavy traffic)
Arrival Rate!
Mean Traffic Flow!
1!
0.023333%
2!
0.011667%
3!
0.007778%
4!
0.005833%
5!
0.004667%
6!
0.003889%
7!
0.003333%
8!
0.002917%
9!
0.002593%
10!
0.002333%
%
Team%# %28922% % Changkun%Ou,%M u%Huang,%Mengxin%Shi%%%% %%%%%%%%%%Page%35%of%35%
Table 7.2.3
( )
EQ
theoretical value ("right rule" light traffic)
Arrival Rate
Theoretical Results
Simulation Results
1
0.016667
0.009987
2
0.008333
0.009541
3
0.005556
0.008132
4
0.004167
0.007397
5
0.003333
0.005163
6
0.002778
0.003822
7
0.002381
0.003214
8
0.002083
0.002664
9
0.001852
0.001785
10
0.001667
0.001128
%